package cn.tedu.boot421.mapper;

import cn.tedu.boot421.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    //通过用户名查询用户信息 如果查询到了数据 User对象有值  没有查询到方法返回值为null
    @Select("select * from user where username=#{name}")
    User selectByUsername(String username);

    @Insert("insert into user values(null,#{username},#{password},#{nick},#{age})")
    void insert(User user);
}
